<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 
<%@ page import="com.lmpop.trade.ti_advpara.*" %>
<%@ page import="com.lmpop.frame.util.*" %>
<%
	RandomID randomID = new RandomID();
	String adv_id = randomID.GenTradeId();
	
		Ti_advpara ti_advpara = new Ti_advpara();

		String cust_id="",user_id="";	
	if( session.getAttribute("session_cust_id") != null )
	{
		cust_id = session.getAttribute("session_cust_id").toString();
		ti_advpara.setCust_id(cust_id);
	}
	if( session.getAttribute("session_user_id") != null )
	{
		user_id = session.getAttribute("session_user_id").toString();
	}
	String advSelect = new Ti_advparaInfo().getAdvparaSelected(ti_advpara);
	
%>
<html>
  <head>
    <title>新增广告信息</title>
	<link href="/program/admin/index/css/style.css" rel="stylesheet" type="text/css">
	<script language="javascript" type="text/javascript" src="/program/plugins/calendar/WdatePicker.js"></script>
	<script language="javascript" type="text/javascript" src="js_advInfo.js"></script>
</head>

<body>
	<h1>新增广告信息</h1>
	
	<form action="/doTradeReg.do" method="post" name="addForm">
	
	<table width="100%" cellpadding="1" cellspacing="1" border="0" class="listtab">

		<tr>
			<td align="right" width="10%">
					广告名称<font color="#ff0000">*</font>
			</td>
			<td colspan="3" ><input name="adv_title" id="adv_title" style="width:200px;" type="text" maxlength="100" /></td>
		</tr>
		
		<tr>
			<td align="right" valign="center" class="list_left_box">
				广&nbsp;告&nbsp;位<font color="#ff0000">*</font>
			</td>
			<td valign="center" colspan="3" >
				<select name="pos_id" id="pos_id" >
					<option value="">请选择</option>
					<%=advSelect%>
				</select>
			</td>
		</tr>
		<input name="pos_id" id="pos_id" type="hidden" value="" />
		<tr>
			<td align="right" width="10%">
				广告来源:
			</td>
			<td colspan="3" ><input name="adv_src" id="adv_src" type="text" style="width:200px;"/></td>
		</tr>

		<tr>
			<td align="right" valign="center" class="list_left_box">
			广告链接<font color="#ff0000">*</font>
			</td>
			<td valign="center" colspan="12" >
				<input name="adv_url" id="adv_url" type="text" style="color:#999999;width:200px;" value="http://" maxlength="300" class="input" />
			</td>
		</tr>
				
				<tr>
			<td align="right" width="10%">
				链接图片:
			</td>
			<td colspan="3">
				<jsp:include page="/program/inc/uploadImgInc.jsp">
					<jsp:param name="attach_root_id" value="<%=adv_id%>" />
				</jsp:include>
			</td>
		</tr>
				
				
		<tr>
			<td align="right" width="15%">
				开始时间<font color="#ff0000">*</font>
			</td>
			<td width="20%">
				<input name="start_date" id="start_date" type="text" onclick="WdatePicker({maxDate:'#F{$dp.$D(\'end_date\',{d:-1})}',readOnly:true})" style="width:200px;" class="Wdate" maxlength="10" />
			</td>

			<td align="right" width="15%">
					结束时间<font color="#ff0000">*</font>
			<td>
				<input name="end_date" id="end_date" type="text" onclick="WdatePicker({minDate:'#F{$dp.$D(\'start_date\',{d:1})}',readOnly:true})" style="width:200px;" class="Wdate"  value="" maxlength="10" />
			</td>
		</tr>
			
		<tr>
			<td align="right" valign="top" class="list_left_box">
		 广告文本:
			</td>
			<td valign="center" colspan="3">
				<textarea name="adv_text" id="adv_text" cols="50" rows="6" onKeyUp="if(this.value.length > 500) this.value=this.value.substr(0,500)" ></textarea>
				<script type="text/javascript" src="/program/plugins/ckeditor/ckeditor.js"></script>
				<script type="text/javascript">
					//CKEDITOR.replace('adv_text');
	 
					 CKEDITOR.replace( 'adv_text',{
						filebrowserUploadUrl : '/program/inc/upload.jsp?type=file&attach_root_id=<%=adv_id%>',      
						filebrowserImageUploadUrl : '/program/inc/upload.jsp?type=img&attach_root_id=<%=adv_id%>',      
						filebrowserFlashUploadUrl : '/program/inc/upload.jsp?type=flash&attach_root_id=<%=adv_id%>'     
					});  
				</script>
			</td>
		</tr>		
		<tr>
			<td align="right" width="10%">
				联&nbsp;系&nbsp;人:
			</td>
			<td ><input name="contact" id="contact" type="text" style="width:200px;" maxlength="300" />
			<td align="right" width="10%">
				联系方式:
			</td>
			<td colspan="3" ><input name="contact_info" id="contact_info" style="width:200px;" type="text" maxlength="300" onblur="isNum();" /></td>
		</tr>

	</table>
	

	<input name="cust_id" id="cust_id" type="hidden" value="<%=cust_id%>" />
	<input name="in_date" id="in_date" type="hidden"  value="" />
	<input name="user_id" id="user_id" type="hidden" value="<%=user_id%>" />
	<input name="adv_id" id="adv_id" type="hidden" value="<%=adv_id%>" />
	<input name="remark" id="remark" type="hidden" value="" />
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td align="center">
				<input type="hidden" name="bpm_id" value="3344" />
				<input class="buttoncss" type="button" name="tradeSub" value="提交" onclick="return subForm();" />&nbsp;&nbsp;
				<input class="buttoncss" type="button" name="tradeRut" value="返回" onclick="window.location.href='index.jsp';"/>
			</td>
		</tr>
	</table>
	</form>
</body>

</html>
